Skip to content

feat(spec): mint spec numbers against open PR heads too - #661

Merged
tieubao merged 3 commits into
masterfrom
feat/spec-next-open-prs
Sep 16, 2026
Merged

tieubao merged 3 commits into
masterfrom
feat/spec-next-open-prs

Conversation

@tieubao

@tieubao tieubao commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

  • spec-next.sh next folds every open PR's docs/specs/ listing into the max-number scan (GitHub contents API on the PR head, no clone, no fetch), skippable via SPEC_NEXT_NO_PR_SCAN=1, falling back to the original local-only scan with a stderr note when gh is missing/unauthenticated/fails.
  • Closes the gap that let three parallel workers each mint SPEC-289 on 2026-09-16: none of the old surfaces (docs/specs/, branches, commit subjects) show a number an unmerged open PR already holds.
  • Board rows filed: ID-904 (this change), ID-903 (session observe --errors <tool> flag, full lane, goal draft at .claude/goals/observe-tool-errors.md, not built here).

Test plan

  • bash tests/test-spec-next-pr-scan.sh (new, 7/7 green)
  • bash tests/test-spec-reserve.sh (unaffected, 41/41 green)
  • bash tests/run-all.sh (all 152 suites green)
  • Negative control via lib/gate/negctl.sh (RED under mutation, GREEN after restore) — see docs/verification/spec-next-open-pr-heads.md

Three parallel workers this week each got the same SPEC number because
spec-next only scanned docs/specs/, local branches, and commit subjects;
none of those surfaces show a number an unmerged open PR already holds,
and none of the workers called reserve. Fold in a gh-backed scan of
every open PR head's docs/specs/ listing via the contents API (no
clone, no fetch). Falls back to the old local-only scan with a stderr
note when gh is missing, unauthenticated, or any bootstrap call fails;
skippable via SPEC_NEXT_NO_PR_SCAN=1 for hermetic tests.
@tieubao
tieubao merged commit 2ca7966 into master Sep 16, 2026
1 check failed
@tieubao
tieubao deleted the feat/spec-next-open-prs branch September 23, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant